package com.aiyige.model;

public class Divide {
    double max;
    double min;
    double defaultValue;
    long timestamp;

    public Divide() {
    }

    private Divide(Builder builder) {
        setMax(builder.max);
        setMin(builder.min);
        setDefaultValue(builder.defaultValue);
        setTimestamp(builder.timestamp);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public double getMax() {
        return max;
    }

    public void setMax(double max) {
        this.max = max;
    }

    public double getMin() {
        return min;
    }

    public void setMin(double min) {
        this.min = min;
    }

    public double getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(double defaultValue) {
        this.defaultValue = defaultValue;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public static final class Builder {
        private double max;
        private double min;
        private double defaultValue;
        private long timestamp;

        private Builder() {
            max = 1;
            min = 0;
            defaultValue = 0;
            timestamp = 0;
        }

        public Builder max(double val) {
            max = val;
            return this;
        }

        public Builder min(double val) {
            min = val;
            return this;
        }

        public Builder defaultValue(double val) {
            defaultValue = val;
            return this;
        }

        public Builder timestamp(long val) {
            timestamp = val;
            return this;
        }

        public Divide build() {
            return new Divide(this);
        }
    }
}
